/**
 * All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
 * SysAppService
 * 开放系统
 * 修改纪录
 * 2020-06-29 版本：1.0 zhanglongfei 创建。
 * 
 * @version 版本：1.0
 * @author 作者：zhanglongfei
 * 创建日期：2020-06-29
 */
package com.topscomm.sys.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.topscomm.sys.pojo.SysAppEntity;
import com.topscomm.sys.service.ISysAppService;
import com.topscomm.sys.service.impl.auto.SysAppServiceAuto;

@Service(value = "sysAppService")
@Scope(value = "singleton")
public class SysAppService extends SysAppServiceAuto implements ISysAppService {
	/**
	 * @description:根据AppKey获取对象
	 * @param appKey
	 * @return
	 * @author: zhanglongfei
	 * @date: 2020年7月2日上午11:28:57
	 * @modify:
	 */
	@Override
	public SysAppEntity queryByAppKey(String appKey) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("appkey", appKey);
		List<SysAppEntity> list = query(paramMap, "queryByAppKey");
		if (list == null || list.size() == 0) {
			return null;
		} else {
			return list.get(0);
		}
	}

	@Override
	public SysAppEntity queryByAppCode(String appCode) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("appcode", appCode);
		List<SysAppEntity> list = query(paramMap, "queryByAppCode");
		if (list == null || list.size() == 0) {
			return null;
		} else {
			return list.get(0);
		}
	}
}
